﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using AvansRS.Domain;
using System.Web.Security;
using System.Web.UI;
using AvansRS.Domain.DataInterface;
using StructureMap;

namespace AvansRS.Web.Util
{
    public class SessionHelper
    {
        public static Person GetLoggedIn(IPrincipal user)
        {
            IPersonRepository personRepository = ObjectFactory.GetInstance<IPersonRepository>();

            string username = user.Identity.Name;

            Person person = personRepository.FindByAccountUsername(username);

            return person;
        }
    }
}
